

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#stdint.h" class="nav-sub-label">stdint.h</a>
              </li>
      

              <li>
                <a href="#stdbool.h" class="nav-sub-label">stdbool.h</a>
              </li>
      

              <li>
                <a href="#pegasus_frame.h" class="nav-sub-label">pegasus_frame.h</a>
              </li>
      

              <li>
                <a href="#tuya_cloud_wifi_defs.h" class="nav-sub-label">tuya_cloud_wifi_defs.h</a>
              </li>
      

              <li>
                <a href="#tuya_cloud_com_defs.h" class="nav-sub-label">tuya_cloud_com_defs.h</a>
              </li>
      

              <li>
                <a href="#tuya_iot_dev_check.h" class="nav-sub-label">tuya_iot_dev_check.h</a>
              </li>
      

              <li>
                <a href="#wifi_netcfg_frame_sniffer.h" class="nav-sub-label">wifi_netcfg_frame_sniffer.h</a>
              </li>
      

              <li>
                <a href="#wifi_netcfg_frame_transporter.h" class="nav-sub-label">wifi_netcfg_frame_transporter.h</a>
              </li>
      

              <li>
                <a href="#netcfg_module.h" class="nav-sub-label">netcfg_module.h</a>
              </li>
      

              <li>
                <a href="#wl_cfg_com.h" class="nav-sub-label">wl_cfg_com.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#__SVC_PEGASUS_H__" class="nav-sub-label">__SVC_PEGASUS_H__</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#pegasus_server_mqc_handle" class="nav-sub-label">pegasus_server_mqc_handle</a>
              </li>
      

              <li>
                <a href="#pegasus_server_second_start" class="nav-sub-label">pegasus_server_second_start</a>
              </li>
      

              <li>
                <a href="#pegasus_recv_data_handle_cb" class="nav-sub-label">pegasus_recv_data_handle_cb</a>
              </li>
      

              <li>
                <a href="#pegasus_server_add_device" class="nav-sub-label">pegasus_server_add_device</a>
              </li>
      

              <li>
                <a href="#tuya_scan_all_ap" class="nav-sub-label">tuya_scan_all_ap</a>
              </li>
      

              <li>
                <a href="#pegasus_beacon_info_get" class="nav-sub-label">pegasus_beacon_info_get</a>
              </li>
      

              <li>
                <a href="#pegasus_init" class="nav-sub-label">pegasus_init</a>
              </li>
      

              <li>
                <a href="#pegasus_second_init" class="nav-sub-label">pegasus_second_init</a>
              </li>
      

              <li>
                <a href="#pegasus_uninit" class="nav-sub-label">pegasus_uninit</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#WLAN_MANAGEMENT_S" class="nav-sub-label">WLAN_MANAGEMENT_S</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#pegasus_mode_t;
" class="nav-sub-label">pegasus_mode_t;
</a>
              </li>
      

              <li>
                <a href="#pegasus_stat_t;
" class="nav-sub-label">pegasus_stat_t;
</a>
              </li>
      

              <li>
                <a href="#pegasus_info_t;
" class="nav-sub-label">pegasus_info_t;
</a>
              </li>
      

              <li>
                <a href="#fnLockChanCb" class="nav-sub-label">fnLockChanCb</a>
              </li>
      

              <li>
                <a href="#pegasus_second_connect_cb" class="nav-sub-label">pegasus_second_connect_cb</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="stdint.h"><span>stdint.h</span></h4>
      <pre class="doc-declare"><code>#include "stdint.h"
</code></pre>
      <pre class="doc-comment">#include "stdint.h"
</pre>

      <h4 id="stdbool.h"><span>stdbool.h</span></h4>
      <pre class="doc-declare"><code>#include "stdbool.h"
</code></pre>
      <pre class="doc-comment">#include "stdbool.h"
</pre>

      <h4 id="pegasus_frame.h"><span>pegasus_frame.h</span></h4>
      <pre class="doc-declare"><code>#include "pegasus_frame.h"
</code></pre>
      <pre class="doc-comment">#include "pegasus_frame.h"
</pre>

      <h4 id="tuya_cloud_wifi_defs.h"><span>tuya_cloud_wifi_defs.h</span></h4>
      <pre class="doc-declare"><code>#include "tuya_cloud_wifi_defs.h"
</code></pre>
      <pre class="doc-comment">#include "tuya_cloud_wifi_defs.h"
</pre>

      <h4 id="tuya_cloud_com_defs.h"><span>tuya_cloud_com_defs.h</span></h4>
      <pre class="doc-declare"><code>#include "tuya_cloud_com_defs.h"
</code></pre>
      <pre class="doc-comment">#include "tuya_cloud_com_defs.h"
</pre>

      <h4 id="tuya_iot_dev_check.h"><span>tuya_iot_dev_check.h</span></h4>
      <pre class="doc-declare"><code>#include "tuya_iot_dev_check.h"
</code></pre>
      <pre class="doc-comment">#include "tuya_iot_dev_check.h"
</pre>

      <h4 id="wifi_netcfg_frame_sniffer.h"><span>wifi_netcfg_frame_sniffer.h</span></h4>
      <pre class="doc-declare"><code>#include "wifi_netcfg_frame_sniffer.h"
</code></pre>
      <pre class="doc-comment">#include "wifi_netcfg_frame_sniffer.h"
</pre>

      <h4 id="wifi_netcfg_frame_transporter.h"><span>wifi_netcfg_frame_transporter.h</span></h4>
      <pre class="doc-declare"><code>#include "wifi_netcfg_frame_transporter.h"
</code></pre>
      <pre class="doc-comment">#include "wifi_netcfg_frame_transporter.h"
</pre>

      <h4 id="netcfg_module.h"><span>netcfg_module.h</span></h4>
      <pre class="doc-declare"><code>#include "netcfg_module.h"
</code></pre>
      <pre class="doc-comment">#include "netcfg_module.h"
</pre>

      <h4 id="wl_cfg_com.h"><span>wl_cfg_com.h</span></h4>
      <pre class="doc-declare"><code>#include "wl_cfg_com.h"
</code></pre>
      <pre class="doc-comment">#include "wl_cfg_com.h"
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="__SVC_PEGASUS_H__">Marco <span>__SVC_PEGASUS_H__</span></h4>
      <pre class="doc-declare"><code>#define __SVC_PEGASUS_H__
</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="pegasus_server_mqc_handle">Func <span>pegasus_server_mqc_handle</span></h4>
      <pre class="doc-declare"><code>int pegasus_server_mqc_handle(ty_cJSON *root_json);</code></pre>
      <pre class="doc-comment">/*============================ PROTOTYPES ====================================*/</pre>

      <h4 id="pegasus_server_second_start">Func <span>pegasus_server_second_start</span></h4>
      <pre class="doc-declare"><code>int pegasus_server_second_start(uint32_t timeout_s);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_recv_data_handle_cb">Func <span>pegasus_recv_data_handle_cb</span></h4>
      <pre class="doc-declare"><code>int pegasus_recv_data_handle_cb(void *ptrArgs,uint8_t *buffer, uint16_t length, const int8_t rssi);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_server_add_device">Func <span>pegasus_server_add_device</span></h4>
      <pre class="doc-declare"><code>int pegasus_server_add_device(char *token, char*uuid);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="tuya_scan_all_ap">Func <span>tuya_scan_all_ap</span></h4>
      <pre class="doc-declare"><code>int tuya_scan_all_ap(AP_IF_S **ap_ary, uint8_t *num, uint8_t *oui, AP_IF_S **oui_ap);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_beacon_info_get">Func <span>pegasus_beacon_info_get</span></h4>
      <pre class="doc-declare"><code>int pegasus_beacon_info_get(uint8_t *buf, uint16_t len, char rssi, AP_IF_S *ap_info);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_init">Func <span>pegasus_init</span></h4>
      <pre class="doc-declare"><code>int pegasus_init(IN CONST fnLockChanCb lc_cb, IN CONST FN_NETCFG_CB ncf_cb, ptrWifiNetcfgFrameSniffer_t pSniffer,ptrWifiNetcfgFrameTransporter_t pTransporter);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_second_init">Func <span>pegasus_second_init</span></h4>
      <pre class="doc-declare"><code>int pegasus_second_init(pegasus_second_connect_cb connect_cb, AP_IF_S *pegasus_ap);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_uninit">Func <span>pegasus_uninit</span></h4>
      <pre class="doc-declare"><code>int pegasus_uninit(void);</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="vars">Vars</h3>
      

      <h4 id="WLAN_MANAGEMENT_S">Variable <span>WLAN_MANAGEMENT_S</span></h4>
      <pre class="doc-declare"><code>WLAN_MANAGEMENT_S *pegasus_find_oui(uint8_t *buf, int buf_len, uint8_t *oui);</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="consts">Consts</h3>
      
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="pegasus_mode_t;
">Typedef <span>pegasus_mode_t;
</span></h4>
      <pre class="doc-declare"><code>typedef enum {
   PEGASUS_CLIENT_MODE_FIRST,             
   PEGASUS_CLIENT_MODE_SECOND, 
   PEGASUS_SERVER_MODE_FIRST,             
   PEGASUS_SERVER_MODE_SECOND, 
} pegasus_mode_t;
</code></pre>
      <pre class="doc-comment">/*============================ TYPES =========================================*/</pre>

      <h4 id="pegasus_stat_t;
">Typedef <span>pegasus_stat_t;
</span></h4>
      <pre class="doc-declare"><code>typedef enum {
   PEGASUS_IDLE,//0
   PEGASUS_SEND_REQ,//1
   PEGASUS_RECV_REQ,  //2
   PEGASUS_SEND_ACK,     //3
   PEGASUS_RECV_ACK, //4
   PEGASUS_CALC_KEY,//5
   PEGASUS_CHECKING,//6
   PEGASUS_SEND_MQTT,//7
   PEGASUS_RECV_MQTT,//8
   PEGASUS_SEND_CHECK, //9
   PEGASUS_RECV_CHECK,//10
   PEGASUS_SEND_CFG,     //11
   PEGASUS_RECV_CFG,         //12
   PEGASUS_CONNECT,//13
} pegasus_stat_t;
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_info_t;
">Typedef <span>pegasus_info_t;
</span></h4>
      <pre class="doc-declare"><code>typedef struct {
   bool               ack;
   int                count;
   uint8_t            dev_mac[6];   
   uint8_t            ap_mac[6];
   char               pid[PRODUCT_KEY_LEN + 1];
   char               uuid[GW_UUID_LEN + 1];
   uint8_t            ra_uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE];  
   uint8_t            ra_aes [TY_DEV_RANDOM_AES_LEN];          
   uint8_t            ra_hmac[TY_DEV_SHA256_DIGEST_SIZE];      
   uint8_t            rb_aes[TY_DEV_RANDOM_AES_LEN];           
   uint8_t            rb_hmac[TY_DEV_SHA256_DIGEST_SIZE];        
   uint8_t            uuid_hmac[TY_DEV_SHA256_DIGEST_SIZE];      
   uint8_t            key[TY_DEV_SESSION_KEY_LEN];
   pegasus_stat_t     stat;
   pegasus_mode_t     mode;
} pegasus_info_t;
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="fnLockChanCb">Typedef <span>fnLockChanCb</span></h4>
      <pre class="doc-declare"><code>typedef void (*fnLockChanCb)(void);
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="pegasus_second_connect_cb">Typedef <span>pegasus_second_connect_cb</span></h4>
      <pre class="doc-declare"><code>typedef int (*pegasus_second_connect_cb)(char *ssid, char *passwd);
</code></pre>
      <pre class="doc-comment"></pre>
    </div>
  </body>
</html>
            